package jude.java.money.net.ftp;

public class FtpFile {

	private String name;
	private String path;
	private boolean dir;
	
	public FtpFile(String fileName) {
		this.name = fileName;
		int len = fileName == null ? 0 : fileName.trim().length();
		this.dir = len > 0 && fileName.charAt(len - 1) == AFtp.separatorChar;
	}
	
	public FtpFile(String fileName, boolean dir) {
		this.name = fileName;
		this.dir = dir;
	}
	
	public String getName() {
		return name;
	}
	
	public boolean isDirectory() {
		return dir;
	}
	
	public String getPath() {
		return path;
	}
	
	public void setPath(String path) {
		this.path = path;
	}
	
	@Override
	public String toString() {
		return (dir ? "D " : "  ") + name;
	}
}
